package com.platform.hjt.sys.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.platform.hjt.sys.model.json.SysCompanyInfoSerialize;

/**
 * SysState entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_state")
public class SysState implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -2894061079259542533L;
	private String sysStateId;
	private SysCompanyInfo sysCompanyInfo;
	@NotBlank(message="表名不能为空")
	@Length(max=100, message="表名长度不能超过50个字")
	private String tableName;
	@NotBlank(message="行值不能为空")
	@Length(max=100, message="行值长度不能超过50个字")
	private String tableColumn;
	@NotBlank(message="值不能为空")
	@Length(max=100, message="值长度不能超过50个字")
	private String tableKey;
	
	private String tableValue;
	private Timestamp createTime;
	private Boolean isDel;
	private Integer sortIndex;

	// Constructors

	/** default constructor */
	public SysState() {
	}

	/** minimal constructor */
	public SysState(String sysStateId) {
		this.sysStateId = sysStateId;
	}

	/** full constructor */
	public SysState(String sysStateId, SysCompanyInfo sysCompanyInfo,
			String tableName, String tableColumn, String tableKey,
			String tableValue, Timestamp createTime, Boolean isDel,
			Integer sortIndex) {
		this.sysStateId = sysStateId;
		this.sysCompanyInfo = sysCompanyInfo;
		this.tableName = tableName;
		this.tableColumn = tableColumn;
		this.tableKey = tableKey;
		this.tableValue = tableValue;
		this.createTime = createTime;
		this.isDel = isDel;
		this.sortIndex = sortIndex;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="systemUUID",strategy="uuid")
	@GeneratedValue(generator="systemUUID")
	@Column(name = "sys_state_id", unique = true, nullable = false, length = 32)
	public String getSysStateId() {
		return this.sysStateId;
	}

	public void setSysStateId(String sysStateId) {
		this.sysStateId = sysStateId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_company_info_id")
	@JsonSerialize(using = SysCompanyInfoSerialize.class)
	public SysCompanyInfo getSysCompanyInfo() {
		return this.sysCompanyInfo;
	}

	public void setSysCompanyInfo(SysCompanyInfo sysCompanyInfo) {
		this.sysCompanyInfo = sysCompanyInfo;
	}

	@Column(name = "table_name", length = 50)
	public String getTableName() {
		return this.tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	@Column(name = "table_column", length = 50)
	public String getTableColumn() {
		return this.tableColumn;
	}

	public void setTableColumn(String tableColumn) {
		this.tableColumn = tableColumn;
	}

	@Column(name = "table_key", length = 1)
	public String getTableKey() {
		return this.tableKey;
	}

	public void setTableKey(String tableKey) {
		this.tableKey = tableKey;
	}

	@Column(name = "table_value", length = 200)
	public String getTableValue() {
		return this.tableValue;
	}

	public void setTableValue(String tableValue) {
		this.tableValue = tableValue;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "is_del")
	public Boolean getIsDel() {
		return this.isDel;
	}

	public void setIsDel(Boolean isDel) {
		this.isDel = isDel;
	}

	@Column(name = "sort_index")
	public Integer getSortIndex() {
		return this.sortIndex;
	}

	public void setSortIndex(Integer sortIndex) {
		this.sortIndex = sortIndex;
	}

}